Data and replication code for 
"Correlation of Brothers' Earnings and Intergenerational Transmission" 
by Paul Bingley and Lorenzo Cappellari


Contact: Lorenzo.Cappellari@unicatt.it

All data and codes are in STATA version 14.1


**DATA DESCRIPTION**
The data used in this analysis are drawn from Danish administrative registers and are confidential. 
However, our access is not unique and others can gain similar access by following a procedure described by Statistics Denmark 
at http://www.dst.dk/en/TilSalg/Forskningsservice.aspx.

Researchers need to submit a written application to Statistics Denmark. The application should include a detailed research proposal 
describing the goals and methods of the project, a detailed list of variables, and the selection criteria to be used. 
Once received, applications must be approved by the Danish Data Protection Agency in order to ensure that data are processed in a manner 
that protects the confidentiality of registered individuals. 

Conditional on these approvals, Statistics Denmark will then determine which data one may obtain in accordance with the research plan. 
All processing of individual data takes place on servers located at Statistics Denmark via secure remote terminal access. 



**REPLICATION CODES**
Master.do runs all the files of the analysis, which are listed below


1.  triplet-data-creation-20160706.do: sources original earnings data from Statistics Denmark servers and save 
    earnwide-triplet-father-1935-1969-son-1955-1989.dta into local directory.
    It contains the following variables: pnr (person identifier), pnrf (family identifier), dob (date of birth), border (birth order, 0=father), 
    earny (annual income for labor in 2012 Danish Krone, y=1980 through to 2014) 

2.  data-creation-triplet-education.do: sources original education data from Statistics Denmark servers and save fatherandoffspringschooling.dta 
    into local directory. It contains the following variables:  pnr (person identifier), educ (own years of completed education), 
    educf (father's year of completed education)

3.  inspection.do: selects sample for the earnings analysis

4.  descriptives.do: produces Table 1 

5.  demean.do: residualizes earnings

6.  merxn.do: estimates earnings moments of the individual-level covariance structure and their variance by type of family member (F, S1, S2) and birth cohort.
    It calls covaxn.do [estimates moments for each member-cohort combination] and accinit.do [appends moments over cohorts by member]

7.  demean_extrad.do: estimates earnings moments of the cross-member covariance structure and their variance by birth cohorts, and appends them over birth cohorts.
    It calls covaxn_extrad.do [estimates moments for each couple of member types-cohort combination]

8.  correlation_newter.do: produces Figure 1. It calls reconstruct_extrad.do [assembles the various sets of moments produced by 6. and 7.]

9.  model_spl_tw_tco_fx_WN_notime.do: estimates the model of Table 2. It calls reconstruct_extrad.do [assembles the various sets of moments produced by 6. and 7.] and 
    diagncobis.do [S.E. adjustment for EWMD estimator and Newey's (1985) chi2 statistic] 

10. model_rwIDrgREIG.do: estimates the model of Table 3 and Figure 2. It calls reconstruct_extrad.do [assembles the various sets of moments produced by 6. and 7.] and 
    diagncobis.do [S.E. adjustment for EWMD estimator and Newey's (1985) chi2 statistic] 

11. corrcov_TI.do: produces the estimates for Table 4

12. het_IGE.do: produces the estimates for Table 5
